#ifndef __TEST_STEERING_AI_HANDLER_HPP__
#define __TEST_STEERING_AI_HANDLER_HPP__

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <vector>

#include "../Entity/BaseEntityHandler.hpp"

////////////////////////////////////////////////////////////
/// Handler for an AIEntity
////////////////////////////////////////////////////////////
class TestSteeringAIHandler : public BaseEntityHandler
{
public:
    ////////////////////////////////////////////////////////////
    /// Constructor
    ///
    ////////////////////////////////////////////////////////////
                            TestSteeringAIHandler();
    ////////////////////////////////////////////////////////////
    /// Copy Constructor
    ///
    /// \param _Copy :      Handler to copy from
    ///
    ////////////////////////////////////////////////////////////
                            TestSteeringAIHandler( const TestSteeringAIHandler& _Copy );
    ////////////////////////////////////////////////////////////
    /// Destructor
    ///
    ////////////////////////////////////////////////////////////
    virtual                 ~TestSteeringAIHandler();

    ////////////////////////////////////////////////////////////
    /// Does an render of things that doesn't usually happen
    ///
    ////////////////////////////////////////////////////////////
    virtual void            Render();
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from properties
    /// BaseObjectHandler::InitFromGrid need to be called AFTER the specialized class
    ///
    /// \param _pPropertyGrid :      Grid where infos are stored
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromGrid( wxPropertyGrid* _pPropertyGrid );
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from an XMLElement
    /// BaseObjectHandler::InitFromXML need to be called AFTER the specialized class
    ///
    /// \param _pElement :           XML Element with info
    /// \param _ProjectPath :        Path to the project
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromXML( tinyxml2::XMLElement* _pElement, const wxString& _ProjectPath );
    
    ////////////////////////////////////////////////////////////
    /// PostInit
    ///
    ////////////////////////////////////////////////////////////
    virtual void            PostInit();
    
    ////////////////////////////////////////////////////////////
    /// Return the value of a property
    ///
    /// \param _PropertyName :      Name of the property
    ///
    /// \return The value as a string
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        GetValueAsString( const wxString& _PropertyName ) const;
    
    ////////////////////////////////////////////////////////////
    /// Handle the change of a property and apply it to the object
    ///
    /// \param _pPropertyGrid :      The property grid
    /// \param _pChangedProperty :   Property that has been changed
    ///
    /// \return Whether the object has been changed or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            OnPropertyChanged( wxPropertyGrid* _pPropertyGrid, wxPGProperty* _pChangedProperty );
    
    ////////////////////////////////////////////////////////////
    /// Handle the double click on a property
    ///
    /// \param _pPropertyGrid :      The property grid
    /// \param _pChangedProperty :   Property that has been changed
    ///
    /// \return Whether the object has been changed or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            OnPropertyDoubleClick( wxPropertyGrid* _pPropertyGrid, wxPGProperty* _pChangedProperty );
    
    ////////////////////////////////////////////////////////////
    /// Get the name of the object handler
    ///
    /// \return the name of the object handler
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        GetName() const;

    CREATE_CLONE_FUNC(TestSteeringAIHandler, BaseXMLObject)

protected:
    wxString                m_SeekPursueEntityHandlerName;
    BaseEntityHandler*      m_pSeekPursueEntityHandler;
    
    wxString                m_FleeEvadeEntityHandlerName;
    BaseEntityHandler*      m_pFleeEvadeEntityHandler;

    std::vector< sf::Vector2f > m_TmpPath;

    ////////////////////////////////////////////////////////////
    /// Create an XML string with the value of the object
    ///
    /// \param _ProjectPath :   Path to the project
    ///
    /// \return the XML String
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        InnerXMLString( const wxString& _ProjectPath = wxEmptyString, const wxString& _Tab = wxT( "\t" ) ) const;
};

////////////////////////////////////////////////////////////
/// Get the name of the object handler
////////////////////////////////////////////////////////////
inline wxString TestSteeringAIHandler::GetName() const {
    return "Test Steering AI Entity";
}

#endif // __TEST_STEERING_AI_HANDLER_HPP__